package com.imonsoft.sqm.web.excel.ClaimExcel;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.imonsoft.common.exception.SystemException;
import com.imonsoft.sqm.service.excel.ClaimExcel.ClaimExcelService;

@Controller
@RequestMapping("/excel/claimExcel")
public class ClaimExcelController {
	protected final Log logger = LogFactory.getLog(getClass());
	@Autowired private ClaimExcelService claimExcelService;
	/**
	 * description Excel导出 on 2013-6-5
	 * 
	 * @author zhouwei
	 */
	@RequestMapping(value = "/exportExcel.do", method = RequestMethod.POST)
	public void exportExcel(HttpServletRequest request, String ids, HttpServletResponse response) throws Exception {
		try {
			claimExcelService.txExportExcel(request, ids, response);
		} catch (SystemException se) {
			logger.info(se.getMessage());
		} catch (Exception e) {
			logger.error(e.getMessage());
		}
	}
	/**
	 * description PDF导出 on 2013-6-5
	 * 
	 * @author zhouwei
	 */
	@RequestMapping(value = "/exportPdf.do", method = RequestMethod.POST)
	public void exportPdf(HttpServletRequest request, String ids, HttpServletResponse response) throws Exception {
		try {
			claimExcelService.txExportPdf(request, ids, response);
		} catch (SystemException se) {
			logger.info(se.getMessage());
		} catch (Exception e) {
			logger.error(e.getMessage());
		}
	}
}
